local weiming = fk.CreateSkill {
  name = "lingling__weiming",
}

Fk:loadTranslationTable{
  ["lingling__weiming"] = "危命",
  [":lingling__weiming"] = "当你翻面后，你可以视为使用一张【杀】。",

  ["#lingling__weiming-invoke"] = "危命：你可以视为使用【杀】",
}

weiming:addEffect(fk.TurnedOver, {
  anim_type = "offensive",
  can_trigger = function (self, event, target, player, data)
    return target == player and player:hasSkill(weiming.name) and
      player:canUse(Fk:cloneCard("slash"), { bypass_times = true })
  end,
  on_cost = function(self, event, target, player, data)
    local room = player.room
    local use = room:askToUseVirtualCard(player, {
      name = "slash",
      skill_name = weiming.name,
      prompt = "#lingling__weiming-invoke",
      cancelable = true,
      extra_data = {
        bypass_times = true,
        extraUse = true,
      },
      skip = true,
    })
    if use then
      event:setCostData(self, {extra_data = use})
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    player.room:useCard(event:getCostData(self).extra_data)
  end,
})

return weiming